﻿using System.Collections.Generic;
using System.Data;

namespace CorsatAdminApp.Library.TempTaskClasses
{

    public enum  GradeEnum
    {
        Fail = 1,
        Accepted = 2,
        Good = 3,
        VeryGood =4,
        Excellent = 5,
    }

    public class Result 
    {
        #region Properties and private fields

        private int _accountId;
        public int AccountId
        {
            get { return _accountId; }
            set { _accountId = value; }
        }

        private string _fullName;
        public string FullName
        {
            get { return _fullName; }
            set { _fullName = value; }
        }

        private float _resultName;
        public float ResultName
        {
            get { return _resultName; }
            set { _resultName = value; }
        }

        private int _gradeId;
        public int GradeId
        {
            get { return _gradeId; }
            set { _gradeId = value; }
        }

        private string _gradeName;
        public string GradeName
        {
            get { return _gradeName; }
            set { _gradeName = value; }
        }

        private DataTable _results;
        public DataTable Results
        {
            get { return _results; }
            set { _results = value; }
        }

        #endregion
       
        #region Constructor       
        public Result()
        {
           
            Results = new DataTable();
            
            Results.Columns.Add("FullName", typeof(string));
            Results.Columns.Add("AccountId", typeof(int));
            Results.Columns.Add(" ResultName", typeof(string));
            Results.Columns.Add(" GradeName", typeof(string));
            Results.Columns.Add(" GradId", typeof(int));
          
            
        }
        #endregion

        #region public Methods
        public void Save()
        {
            DataManger.UpdateAccountResult(this);
        }


        public List<Item> GetAllCourses()
        {
            return DataManger.SelectCourses();
        }
        #endregion



        #region override
        public override string ToString()
        {
            return FullName ;
        }
        #endregion
    }
}
